<template>
	<div class="message-rd">
		<common-header title="详情" isFixed=true></common-header>
		<div class="m-header bottom-1px">
			<h2>{{art.title}}</h2>
			<p class="slh mt10">
				<span class="gray font12">{{art.update_time | formatTime}}</span>
				<span class="gray font12">{{art.writer}}</span>
			</p>
		</div>
		<div class="m-content" v-html="art.content"></div>
	</div>
</template>
<style>
.message-rd .m-content img{
	max-width:100%;
}
</style>
<style scoped lang="scss">
	.message-rd{padding: 44px a(30px);background:#ffffff;}
	.m-header{
		padding: 10px 0;
	}
	.m-content{
		padding: 20px 0;
		img{max-width: 100%;}
	}
</style>

<script>
	import commonHeader from "__cp/commonHeader";
	import {getArticleDetail} from '__api';
	import {fTime} from '__assets/js/util';
	export default{
		name:"message-detail",
		components:{commonHeader},
		data(){
			return{
				art:{}
			}
		},
		filters:{
            formatTime:function(val){
                return fTime(val);
            }
        },
		created(){
			this.getData();
		},
		methods:{
			getData(){
				getArticleDetail({id: this.$route.query.id}).then(res=>{
					this.art = res.article;
				})
			}
		}
	}

</script>